<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:o="http://omnifaces.org/ui"
      xmlns:of="http://omnifaces.org/functions">
    <h:head>
    </h:head>

    <h:body>
        <ui:composition template="/dataverse_template.xhtml">
            <ui:param name="pageTitle" value="#{bundle.account} - #{dataverseServiceBean.findRootDataverse().name}"/>
            <ui:param name="dataverse" value="#{dataverseServiceBean.findRootDataverse()}"/>
            <ui:param name="showDataverseHeader" value="false"/>
            <ui:param name="showMessagePanel" value="#{true}"/>
            <ui:param name="loginRedirectPage" value="dataverseuser.xhtml"/>
            <ui:define name="metadata">
                <f:metadata>
                    <f:event type="preRenderView" listener="#{facesContext.externalContext.response.setHeader('Cache-Control', 'no-cache, no-store')}"/>
                    <o:viewParam name="editMode" value="#{DataverseUserPage.editMode}"/>
                    <f:viewParam name="redirectPage" value="#{DataverseUserPage.redirectPage}"/>
                    <o:viewParam name="selectTab" value="#{DataverseUserPage.selectTab}" default="dataRelatedToMe"/>
                    <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                    <f:viewAction action="#{DataverseUserPage.init}" />
                    <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(dataverseServiceBean.findRootDataverse(), (DataverseUserPage.editMode == 'CREATE' ? bundle['user.createBtn'] : bundle.account))}"/>
                </f:metadata>
            </ui:define>
            <ui:define name="body">
                <!-- 
                 The following script is needed to protect a user's personal data 
                from being seen if they log out of their DV account and the next person who
                sits at their computer hits the back button. (see ticket #3965)
                -->
                <script>

                    //<![CDATA[                   
                    window.onpageshow = function(event) {
                        if (event.persisted) {
                            window.location.reload();
                        }
                    };
                    //]]>
                </script>

                <f:loadBundle basename="propertyFiles.Bundle" var="bundle"/>

                <h1>#{pageTitle}</h1>
                <h:form id="dataverseUserForm">

                    <p:focus context="dataverseUserForm"/>
                    
                    <p:panel rendered="#{DataverseUserPage.editMode == 'FORGOT'}">
                        <h:outputText value="#{bundle['user.lostPasswdTip']}" />
                    </p:panel>

                    <p:tabView id="dataRelatedToMeView" activeIndex="#{DataverseUserPage.activeIndex}" dynamic="true" cache="false" rendered="#{empty DataverseUserPage.editMode}">
                        <p:ajax event="tabChange" listener="#{DataverseUserPage.onTabChange}" update="@all"  />
                        <p:tab id="myData" title="#{bundle['user.dataRelatedToMe']}">
                            <ui:include src="mydata_fragment.xhtml"></ui:include>
                        </p:tab>
                        <p:tab id="notifications" title="#{bundle['header.user.selectTab.notifications']}">
                            <div class="panel panel-default" jsf:rendered="#{settingsWrapper.showMuteOptions}">
                                <div data-toggle="collapse" data-target="#muteCollapse" aria-expanded="false" class="panel-heading text-info" role="button" aria-controls="muteCollapse">
                                    #{bundle['notification.muteOptions']} <span class="glyphicon glyphicon-chevron-down" />
                                </div>
                                <div id="muteCollapse" class="collapse">
                                    <div class="panel-body">
                                        <div class="form-group text-left">
                                            <label for="mutedEmails" class="col-sm-4 control-label">
                                                #{bundle['notification.mutedEmails']}
                                            </label>
                                            <div class="col-sm-8">
                                                <p:selectManyCheckbox id="mutedEmails" value="#{DataverseUserPage.toReceiveEmails}"
                                                    styleClass="grid-checkbox" layout="grid" columns="1">
                                                    <f:selectItems value="#{DataverseUserPage.notificationTypeList}" var="t"
                                                        itemLabel="#{t.description}" itemValue="#{t}"
                                                        itemDisabled="#{DataverseUserPage.isDisabled(t)}" />
                                                </p:selectManyCheckbox>
                                            </div>
                                        </div>
                                        <div class="form-group text-left">
                                            <label for="mutedNotifications" class="col-sm-4 control-label">
                                                #{bundle['notification.mutedNotifications']}
                                            </label>
                                            <div class="col-sm-8">
                                                <p:selectManyCheckbox id="mutedNotifications" value="#{DataverseUserPage.toReceiveNotifications}"
                                                    styleClass="grid-checkbox" layout="grid" columns="1">
                                                    <f:selectItems value="#{DataverseUserPage.notificationTypeList}" var="t"
                                                        itemLabel="#{t.description}" itemValue="#{t}"
                                                        itemDisabled="#{DataverseUserPage.isDisabled(t)}" />
                                                </p:selectManyCheckbox>
                                            </div>
                                        </div>
                                        <p:commandButton id="save" styleClass="btn btn-default" value="#{bundle.saveChanges}"
                                            action="#{DataverseUserPage.save}" onclick="PF('muteCollapse').collapse('hide')" update="@form"/>
                                    </div>
                                </div>
                            </div>
                            <hr/>
                            <div class="table-container">
                                <ui:repeat value="#{DataverseUserPage.notificationsList}" var="item">
                                    <div class="notification-item #{item.displayAsRead ? '' : 'bg-warning'}">
                                        <div class="notification-item-cell">
                                            <ui:fragment rendered="#{item.theObject == null}">
                                                 <h:outputText value="#{bundle['notification.generic.objectDeleted']}" />
                                            </ui:fragment>
                                            <ui:fragment rendered="#{item.theObject != null}">
                                                <ui:fragment rendered="#{item.type == 'CREATEACC'}">
                                                    <span class="icon-dataverse text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.welcome']}" escape="false">
                                                        <o:param>
                                                            <h:outputText value="#{dataverseServiceBean.findRootDataverse().name}"/>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/index.html" title="#{dataverseServiceBean.findRootDataverse().name} #{bundle['header.guides.user']}" target="_blank">#{bundle['header.guides.user']}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="https://demo.dataverse.org">#{bundle['notification.demoSite']}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                    <!--Only show message about an email confirmation link to non-Shib users (Shib users can't edit their accounts)-->
                                                    <h:outputFormat value=" #{bundle['notification.welcomeConfirmEmail']}" rendered="#{DataverseUserPage.accountDetailsEditable}"/>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'CREATEDV'}">
                                                    <span class="icon-dataverse text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.createDataverse']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getAlias()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getOwner().getAlias()}" title="#{item.theObject.getOwner().getDisplayName()}">#{item.theObject.getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/dataverse-management.html" title="#{bundle['notification.dataverse.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'CREATEDS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.createDataset']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/dataset-management.html" title="#{bundle['notification.dataset.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'DATASETCREATED'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.datasetCreated']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getOwner().getAlias()}" title="#{item.theObject.getOwner().getDisplayName()}">#{item.theObject.getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            #{item.requestor.name}
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'SUBMITTEDDS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.wasSubmittedForReview']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            #{DataverseUserPage.getRequestorName(item)}
                                                        </o:param>
                                                        <o:param>
                                                            #{DataverseUserPage.getRequestorEmail(item)}
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'RETURNEDDS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.wasReturnedByReviewer']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                        <!-- Reason for Return - This needs some work in the DataverseUserPage method to get it to work -->
                                                        <ui:remove>
                                                        <o:param>
                                                            #{DataverseUserPage.getReasonForReturn(item.theObject)}
                                                        </o:param>
                                                        </ui:remove>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'PUBLISHEDDS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.wasPublished']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'PUBLISHFAILED_PIDREG'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.publishFailedPidReg']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'REQUESTFILEACCESS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.requestFileAccess']}" escape="false">
                                                        <o:param>
                                                            <a href="/permissions-manage-files.xhtml?id=#{item.theObject.id}" title="#{item.theObject.displayName}">#{item.theObject.displayName}</a>
                                                        </o:param>
                                                        <o:param>
                                                            #{DataverseUserPage.getRequestorName(item)}
                                                        </o:param>
                                                        <o:param>
                                                            #{DataverseUserPage.getRequestorEmail(item)}
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'REQUESTEDFILEACCESS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.requestedFileAccess']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.displayName}">#{item.theObject.displayName}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GRANTFILEACCESS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.grantFileAccess']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.displayName}">#{item.theObject.displayName}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'REJECTFILEACCESS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.rejectFileAccess']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.displayName}">#{item.theObject.displayName}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'ASSIGNROLE'}">
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataverse()}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.access.granted.dataverse']}" escape="false">
                                                        <o:param value="#{item.roleString}"/>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getAlias()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                    <ui:fragment rendered="#{item.roleString == 'File Downloader'}">
                                                        <h:outputFormat value="#{bundle['notification.access.granted.fileDownloader.additionalDataverse']}" escape="false">
                                                            <f:param value=" "/>
                                                        </h:outputFormat>
                                                    </ui:fragment>
                                                    </ui:fragment>
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataset()}">
                                                        <span class="icon-dataset text-icon-inline text-muted"></span>
                                                        <h:outputFormat value="#{bundle['notification.access.granted.dataset']}" escape="false">
                                                            <o:param value="#{item.roleString}"/>
                                                            <o:param>
                                                                <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                            </o:param>
                                                        </h:outputFormat>
                                                        <ui:fragment rendered="#{item.roleString == 'File Downloader'}">
                                                            <h:outputText value="" />
                                                            <h:outputFormat value="#{bundle['notification.access.granted.fileDownloader.additionalDataset']}" escape="false">
                                                                <f:param value=" "/>
                                                            </h:outputFormat>
                                                    </ui:fragment>
                                                    </ui:fragment>
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataFile()}">
                                                    <f:param value="#{item.roleString}"/>
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.access.granted.datafile']}" escape="false">
                                                            <o:param value="#{item.roleString}"/>
                                                            <o:param>
                                                                <a href="/dataset.xhtml?persistentId=#{item.theObject.getOwner().getGlobalId()}" title="#{item.theObject.getOwner().getDisplayName()}">#{item.theObject.getOwner().getDisplayName()}</a>
                                                            </o:param>
                                                    </h:outputFormat>
                                                    </ui:fragment>

                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'REVOKEROLE'}">
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataverse()}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.access.revoked.dataverse']}" escape="false">
                                                            <o:param>
                                                                <a href="/dataverse/#{item.theObject.getAlias()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                            </o:param>
                                                    </h:outputFormat>
                                                    </ui:fragment>
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataset()}">
                                                    <f:param value="#{item.roleString}"/>
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.access.revoked.dataset']}" escape="false">
                                                        <o:param>
                                                                <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                    </ui:fragment>
                                                    <ui:fragment rendered="#{item.theObject.isInstanceofDataFile()}">
                                                    <f:param value="#{item.roleString}"/>
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.access.revoked.datafile']}" escape="false">
                                                        <o:param>
                                                              <a href="/dataset.xhtml?persistentId=#{item.theObject.getOwner().getGlobalId()}" title="#{item.theObject.getOwner().getDisplayName()}">#{item.theObject.getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                    </ui:fragment>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'CHECKSUMFAIL'}">
                                                    <!--
                                                    TODO: Rather than matching on hard-coded strings such as "CHECKSUMFAIL"
                                                    a more type-safe approach would be to use the "Type" enum in UserNotification.
                                                    Also, isInstanceofDataset() should be checked, probably.
                                                    -->
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.checksumfail']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'FILESYSTEMIMPORT'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.import.filesystem']}" escape="false">
                                                        <f:param value="#{item.theObject.getDataset().getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDataset().getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSUPLOADCOMPLETED'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.upload.completed']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSDOWNLOADCOMPLETED'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.download.completed']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSUPLOADCOMPLETEDWITHERRORS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.upload.completedWithErrors']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSUPLOADREMOTEFAILURE'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.upload.failedRemotely']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSUPLOADLOCALFAILURE'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.upload.failedRemotely']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'GLOBUSDOWNLOADCOMPLETEDWITHERRORS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.globus.download.completedWithErrors']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'CHECKSUMIMPORT'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.import.checksum']}" escape="false">
                                                        <f:param value="#{item.theObject.getDataset().getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDataset().getDisplayName()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'APIGENERATED'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.email.apiTokenGenerated.subject']}" escape="false">
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'INGESTCOMPLETED'}">
                                                    <i class="icon-dataset text-icon-inline text-muted"></i>
                                                    <h:outputFormat value="#{bundle['notification.ingestCompleted']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                        <f:param value="#{settingsWrapper.guidesBaseUrl}"/>
                                                        <f:param value="#{settingsWrapper.guidesVersion}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'INGESTCOMPLETEDWITHERRORS'}">
                                                    <i class="icon-dataset text-icon-inline text-muted"></i>
                                                    <h:outputFormat value="#{bundle['notification.ingestCompletedWithErrors']}" escape="false">
                                                        <f:param value="#{item.theObject.getGlobalId()}"/>
                                                        <f:param value="#{item.theObject.getDisplayName()}"/>
                                                        <f:param value="#{settingsWrapper.guidesBaseUrl}"/>
                                                        <f:param value="#{settingsWrapper.guidesVersion}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'WORKFLOW_FAILURE'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.workflowFailed']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'WORKFLOW_SUCCESS'}">
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.workflowSucceeded']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <o:param>
                                                            <a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'STATUSUPDATED'}">
                                                    <o:importFunctions type="edu.harvard.iq.dataverse.dataset.DatasetUtil" />
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.statusUpdated']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <f:param value="#{DatasetUtil:getLocaleCurationStatusLabel(item.theObject.currentCurationStatus)}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'PIDRECONCILED'}">
                                                    <o:importFunctions type="edu.harvard.iq.dataverse.dataset.DatasetUtil" />
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.pidreconciled']}" escape="false">
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getDataset().getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDataset().getDisplayName()}">#{item.theObject.getDataset().getDisplayName()}</a>
                                                        </o:param>
                                                        <f:param value="#{item.theObject.getDataset().getGlobalId()}"/>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                <ui:fragment rendered="#{item.type == 'DATASETMENTIONED'}">
                                                <o:importFunctions type="edu.harvard.iq.dataverse.util.json.JsonUtil" />
                                                    <span class="icon-dataset text-icon-inline text-muted"></span>
                                                    <h:outputFormat value="#{bundle['notification.datasetMentioned']}" escape="false">
                                                    <f:param value="#{JsonUtil:getJsonObject(item.additionalInfo).getString('@type', bundle['notification.datasetMentioned.itemType'])}"/>
                                                    <f:param value="#{JsonUtil:getJsonObject(item.additionalInfo).getString('@id')}"/>
                                                    <f:param value="#{JsonUtil:getJsonObject(item.additionalInfo).getString('name', JsonUtil:getJsonObject(item.additionalInfo).getString('@id'))}"/>
                                                    <f:param value="#{JsonUtil:getJsonObject(item.additionalInfo).getString('relationship', 'isRelatedTo')}"/>
                                                        <o:param>
                                                            <a href="/dataset.xhtml?persistentId=#{item.theObject.getGlobalId()}&amp;version=DRAFT&amp;faces-redirect=true" title="#{item.theObject.getDisplayName()}">#{item.theObject.getDisplayName()}</a>
                                                        </o:param>
                                                    </h:outputFormat>
                                                </ui:fragment>
                                                

                                            </ui:fragment>
                                            <h:outputText value="#{item.localeSendDate}" styleClass="text-muted small"/>
                                        </div>
                                        <div class="notification-item-cell">
                                            <p:commandLink title="#{bundle.removeNotification}" styleClass="bootstrap-button-tooltip"
                                                           action="#{DataverseUserPage.remove(item.id)}" update="@form">
                                                <span class="glyphicon glyphicon-remove"></span>
                                            </p:commandLink>
                                        </div>
                                    </div>
                                </ui:repeat>
                            </div>
                        </p:tab>
                        <p:tab id="accountInfo" title="#{bundle['header.user.selectTab.accountInfo']}">
                            <div class="button-block tab-header margin-bottom text-right" jsf:rendered="#{empty DataverseUserPage.editMode and (DataverseUserPage.passwordEditable or DataverseUserPage.accountDetailsEditable)}">
                                <div class="btn-group">
                                    <button type="button" id="editAccount" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                        <ui:fragment rendered="#{DataverseUserPage.accountDetailsEditable}">
                                            <span class="glyphicon glyphicon-pencil"/> #{bundle['account.edit']}
                                        </ui:fragment>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu pull-right text-left">
                                        <ui:fragment rendered="#{DataverseUserPage.passwordEditable or DataverseUserPage.accountDetailsEditable}">
                                            <li>
                                                <p:commandLink id="editAccount" rendered="#{DataverseUserPage.accountDetailsEditable}"
                                                               actionListener="#{DataverseUserPage.edit}" update="@form">
                                                    <h:outputText value="#{bundle['account.info']}" />
                                                </p:commandLink>
                                            </li>
                                            <li>
                                                <p:commandLink id="changePassword" rendered="#{DataverseUserPage.passwordEditable}" 
                                                               actionListener="#{DataverseUserPage.changePassword}" update="@form">
                                                    <h:outputText value="#{bundle.passwd}" />
                                                </p:commandLink>
                                            </li>
                                            <li>
                                                <p:commandLink id="removeOrcid" rendered="#{!(of:isInstance('edu.harvard.iq.dataverse.authorization.providers.oauth2.impl.OrcidOAuth2AP', DataverseUserPage.userAuthProvider)) and !empty DataverseUserPage.currentUser.authenticatedOrcid}" 
                                                               actionListener="#{DataverseUserPage.removeOrcid}" update="@form">
                                                    <h:outputText value="#{bundle['user.orcid.remove']}" />
                                                </p:commandLink>
                                            </li>
                                        </ui:fragment>
                                    </ul>
                                </div>
                            </div>
                            <div class="metadata-container" jsf:rendered="#{!empty DataverseUserPage.currentUser}">
                                <!-- Shib -->
                                <p class="help-block" id="userShib" jsf:rendered="#{not DataverseUserPage.accountDetailsEditable}">
                                    <h:outputText value="#{bundle['user.isShibUser']}" />
                                    <h:outputText value=" #{bundle['user.helpShibUserMigrateOffShibBeforeLink']} " />
                                    <p:commandLink value="#{settingsWrapper.supportTeamName}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
                                    </p:commandLink>
                                    <h:outputText value=" #{bundle['user.helpShibUserMigrateOffShibAfterLink']}" />
                                </p>
                                <!-- OAuth -->
                                <p class="help-block" id="userOAuth" jsf:rendered="#{DataverseUserPage.userAuthProvider.OAuthProvider}">
                                    <h:outputFormat value="#{bundle['user.helpOAuthBeforeLink']} ">
                                        <f:param value="#{DataverseUserPage.userAuthProvider.info.title}"/>
                                    </h:outputFormat>
                                    <p:commandLink value="#{settingsWrapper.supportTeamName}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{null}"/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
                                        <f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
                                    </p:commandLink>
                                    <h:outputText value=" #{bundle['user.helpOAuthAfterLink']}" />
                                </p>
                                <table class="metadata">
                                    <tbody>
                                        <!-- Username -->
                                        <tr id="userIdentifier">
                                            <th scope="row">
                                                #{bundle['user.username']}
                                            </th>
                                            <td>
                                                #{DataverseUserPage.currentUser.identifier.replaceFirst("@", "")}
                                            </td>
                                        </tr>
                                        <!-- First Name -->
                                        <tr id="userFirstName">
                                            <th scope="row">
                                                #{bundle['user.firstName']}
                                            </th>
                                            <td>
                                                #{DataverseUserPage.currentUser.firstName}
                                            </td>
                                        </tr>
                                        <!-- Last Name -->
                                        <tr id="userLastName">
                                            <th scope="row">
                                                #{bundle['user.lastName']}
                                            </th>
                                            <td>
                                                #{DataverseUserPage.currentUser.lastName}
                                            </td>
                                        </tr>
                                        <!-- Email -->
                                        <tr id="userEmail">
                                            <th scope="row">
                                                #{bundle.email}
                                            </th>
                                            <td>
                                                <p class="form-control-static" style="display:inline-block;">
                                                    <span class="form-control-static">#{DataverseUserPage.currentUser.email}</span>
                                                    &#160;
                                                    <span class="text-danger" jsf:rendered="#{DataverseUserPage.emailNotVerified}">
                                                        <span class="glyphicon glyphicon-ban-circle"/> #{bundle['confirmEmail.notVerified']}
                                                    </span>
                                                    <span class="text-success" jsf:rendered="#{!DataverseUserPage.emailNotVerified}">
                                                        <span class="glyphicon glyphicon-ok"/> #{bundle['confirmEmail.verified']}
                                                    </span>
                                                </p>
                                                &#160;
                                                <p:commandLink rendered="#{DataverseUserPage.showVerifyEmailButton()}" styleClass="btn btn-default" 
                                                                id="verifyEmailButton"
                                                                action="#{DataverseUserPage.sendConfirmEmail()}"
                                                                update="@([id$=verifyEmailButton]), :messagePanel"
                                                               >
                                                    <span class="glyphicon glyphicon-ok"></span> #{bundle['confirmEmail.submitRequest']}
                                                </p:commandLink>
                                            </td>
                                        </tr>
                                        <!-- PersistentId, ORCID iD -->
                                        <tr id="orcid" jsf:rendered="#{DataverseUserPage.currentUser.authenticatedOrcid != null}">
                                            <th scope="row">
                                                #{bundle['user.orcid']}
                                            </th>
                                            <td>
                                                <o:importFunctions type="edu.harvard.iq.dataverse.authorization.providers.oauth2.impl.OrcidOAuth2AP" />
                                                <h:graphicImage value="#{OrcidOAuth2AP:getLogo()}" height="16" width="16" alt="#{of:format1(bundle['alt.logo'], bundle['user.orcid'])}"/>&#160;
                                                <h:outputLink value="#{DataverseUserPage.currentUser.authenticatedOrcid}" title="#{bundle['user.orcid.link']}" target="_blank">
                                                    <h:outputText value="#{DataverseUserPage.orcidForDisplay}"/>
                                                </h:outputLink>
                                            </td>
                                        </tr>
                                        <!-- New row for ORCID authentication button -->
                                        <tr id="orcidAuthentication" jsf:rendered="#{(DataverseUserPage.currentUser.authenticatedOrcid == null) and DataverseUserPage.orcidEnabled}">
                                            <th scope="row">
                                                #{bundle['user.orcid']}
                                            </th>
                                            <td>
                                                <p:commandButton value="#{bundle['user.orcid.authenticate']}"
                                                                 action="#{DataverseUserPage.startOrcidAuthentication()}"
                                                                 styleClass="btn btn-default"
                                                                 update="@form">
                                                    <span class="glyphicon glyphicon-link"></span>
                                                </p:commandButton>
                                            </td>
                                        </tr>
                                        <!-- Affiliation -->
                                        <tr id="userAffiliation" jsf:rendered="#{!empty DataverseUserPage.currentUser.affiliation}">
                                            <th scope="row">
                                                #{bundle.affiliation}
                                            </th>
                                            <td>
                                                #{DataverseUserPage.currentUser.affiliation}
                                            </td>
                                        </tr>
                                        <!-- Position (not populated for Shibboleth users) -->
                                        <tr id="userPosition" jsf:rendered="#{!empty DataverseUserPage.currentUser.position}">
                                            <th scope="row">
                                                #{bundle['user.position']}
                                            </th>
                                            <td>
                                                #{DataverseUserPage.currentUser.position}
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </p:tab>
                        <p:tab id="apiTokenTab" title="#{bundle['apitoken.title']}">
                            <p class="help-block">
                                <h:outputFormat value="#{bundle['apitoken.message']}" escape="false">
                                    <f:param value="&lt;a href=&#34;#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/api&#34; target=&#34;_blank&#34;&gt;"/>
                                    <f:param value="&lt;/a&gt;"/>
                                </h:outputFormat>
                            </p>
                            <div class="metadata-container margin-bottom-half" jsf:rendered="#{ApiTokenPage.apiTokenExpiration != ''}">
                                <table class="metadata">
                                    <tbody>
                                        <tr>
                                            <th scope="row">
                                                <h:outputText value="#{bundle['apitoken.expirationDate.label']}"/>
                                            </th>
                                            <td>
                                                <h:outputText value="#{ApiTokenPage.apiTokenExpiration}"/>
                                            </td>
                                            <td class="text-warning" jsf:rendered="#{ApiTokenPage.tokenIsExpired()}">
                                                <span class="glyphicon glyphicon-warning-sign"></span>
                                                <h:outputText value=" #{bundle['apitoken.expired.error']}"/>
                                            </td>
                                            <!-- leaving warning off for now -->
                                            <td class="text-danger" jsf:rendered="#{false}">
                                                <span class="glyphicon glyphicon-exclamation-sign"></span>
                                                <h:outputText value=" #{bundle['apitoken.expired.warning']}"/>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div id="apiToken" class="highlight hidden">
                                <pre>
                                    <code class="language-html" data-lang="html">#{ApiTokenPage.apiToken}</code>
                                </pre>
                            </div>
                            <!--Script removes "hidden" class from div containing API token to stop javascript browser exploits-->
                            <script>
                                //<![CDATA[
                                $(document).ready(function() {
                                    $("div#apiToken").removeClass("hidden");
                                });
                                //Produces "Are you sure you want to leave this page?" alert to allow API token to hide again
                                $(window).on("beforeunload", function() {
                                    $("div#apiToken").addClass("hidden");
                                });
                                //]]>
                            </script>
                            <div class="btn-toolbar" role="toolbar">
                                <button class="btn btn-default btn-copy" data-clipboard-action="copy" data-clipboard-text="#{ApiTokenPage.apiToken}" type="button" jsf:rendered="#{ApiTokenPage.checkForApiToken() and !ApiTokenPage.tokenIsExpired()}">
                                    #{bundle['copyClipboard']}
                                </button>
                                <button class="btn btn-default" jsf:action="#{ApiTokenPage.generate()}">
                                    #{ApiTokenPage.checkForApiToken() ? bundle['apitoken.regenerateBtn'] : bundle['apitoken.generateBtn']}
                                </button>
                                <button class="btn btn-default" jsf:action="#{ApiTokenPage.revoke()}" jsf:rendered="#{ApiTokenPage.apiTokenExpiration != ''}">
                                    #{bundle['apitoken.revokeBtn']}
                                </button>
                            </div>
                        </p:tab>
                        <ui:remove>
                            <p:tab id="groupsRoles" title="#{bundle['header.user.selectTab.groupsAndRoles']}">
                                #{bundle['groupAndRoles.manageTips']}
                            </p:tab>
                        </ui:remove>
                    </p:tabView>

                    <p:tabView id="accountInfoView" rendered="#{!empty DataverseUserPage.editMode}">
                        <p:tab id="accountInfoEdit" title="#{bundle['account.info']}">
                            <ui:fragment rendered="#{DataverseUserPage.editMode == 'CREATE' and DataverseUserPage.nonLocalLoginEnabled}">
                                <p class="help-block">
                                    <h:outputText value="#{bundle['user.signup.otherLogInOptions.tip']}" escape="false"/>
                                </p>
                            </ui:fragment>
                            <div class="form-horizontal">
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                    <!-- Username -->                                   
                                    <h:outputLabel value="#{bundle['user.username']}" for="userName" class="col-sm-3 control-label">
                                        <span class="glyphicon glyphicon-asterisk text-danger"/>
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.username.illegal.tip']}"></span>
                                    </h:outputLabel> 
                                                                       
                                    <div class="col-sm-9">
                                        <div class="help-block">
                                            <h:outputText value="#{bundle['user.username.valid']}" escape="false">
                                            </h:outputText>
                                        </div>
                                    </div>
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <p:inputText id="userName" styleClass="form-control"
                                                     validator="#{DataverseUserPage.validateUserName}"
                                                     value="#{DataverseUserPage.username}"
                                                     disabled="#{DataverseUserPage.editMode != 'CREATE'}"
                                                     binding="#{DataverseUserPage.usernameField}"/>
                                        <p:message for="userName" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == DataverseUserPage.changePasswordMode}">
                                <!-- Current Password -->
                                    <label for="currentPassword" class="col-sm-3 control-label">
                                        #{bundle['user.currentPasswd']} <span class="glyphicon glyphicon-asterisk text-danger"/>
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.currentPasswd.tip']}"></span>
                                    </label>
                                    <div class="col-sm-4">
                                        <p:password id="currentPassword" label="#{bundle['user.currentPasswd']}" styleClass="form-control" value="#{DataverseUserPage.currentPassword}" autocomplete="off"/><!-- browsers will in general not respect autocomplete="foo", but scanners will still flag it as a potential problem -->
                                        <p:message for="currentPassword" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == DataverseUserPage.changePasswordMode}">
                                <!-- Password -->
                                <h:outputLabel value="#{DataverseUserPage.editMode == 'CREATE' ? bundle['user.password'] : bundle['user.newPassword']}"   for="inputPassword"  class="col-sm-3 control-label" >
                                    <span class="glyphicon glyphicon-asterisk text-danger"></span>
                                    <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                          data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.passwd.illegal.tip']}"></span>
                                </h:outputLabel>      
                                    <div class="col-sm-9">
                                        <div class="help-block">
                                            <h:outputFormat value="#{bundle['user.updatePassword.password']}" escape="false">
                                                <f:param value="#{DataverseUserPage.passwordRequirements}"/>
                                            </h:outputFormat>
                                        </div>
                                    </div>
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <p:password id="inputPassword" label="#{DataverseUserPage.editMode == 'CREATE' ? bundle['user.password'] : bundle['user.newPassword']}" styleClass="form-control" match="retypePassword" value="#{DataverseUserPage.inputPassword}" validator="#{DataverseUserPage.validateNewPassword}" autocomplete="off"/><!-- browsers will in general not respect autocomplete="foo", but scanners will still flag it as a potential problem -->
                                        <p:message for="inputPassword" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == DataverseUserPage.changePasswordMode}">
                                    <!-- Retype Password -->
                                    <h:outputLabel value="#{bundle['user.rePasswd']}" for="retypePassword" class="col-sm-3 control-label"> <span class="glyphicon glyphicon-asterisk text-danger"/>
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.rePasswd.tip']}"></span>
                                    </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:password id="retypePassword" label="#{bundle['user.rePasswd']}" styleClass="form-control" value="#{DataverseUserPage.inputPassword}" autocomplete="off"/><!-- browsers will in general not respect autocomplete="foo", but scanners will still flag it as a potential problem -->
                                        <p:message for="retypePassword" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                <!-- First Name -->                                       
                                <h:outputLabel value="#{bundle['user.firstName']}" for="firstName" class="col-sm-3 control-label" > <span class="glyphicon glyphicon-asterisk text-danger"/>
                                    <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                          data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.firstName.tip']}"></span>
                                </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:inputText id="firstName" styleClass="form-control" value="#{DataverseUserPage.userDisplayInfo.firstName}" />
                                        <p:message for="firstName" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                    <!-- Last Name -->
                                    <h:outputLabel value="#{bundle['user.lastName']}" for="lastName" class="col-sm-3 control-label" >  <span class="glyphicon glyphicon-asterisk text-danger"/>
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.lastName.tip']}"></span>
                                    </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:inputText id="lastName" styleClass="form-control" value="#{DataverseUserPage.userDisplayInfo.lastName}" />
                                        <p:message for="lastName" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                    <!-- Email -->
                                    <h:outputLabel value="#{bundle['email']}" for="email" class="col-sm-3 control-label">   <span class="glyphicon glyphicon-asterisk text-danger"/>
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.email.tip']}"></span>
                                    </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:inputText id="email" styleClass="form-control"
                                                     validator="#{DataverseUserPage.validateUserEmail}"
                                                     value="#{DataverseUserPage.userDisplayInfo.emailAddress}" />
                                        <p:message for="email" display="text" />
                                    </div>
                                </div>
                                <!--FIXME: refactor to remove need for EDIT? userAuthProvider is null on CREATE-->
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                    <!-- Affiliation -->
                                    <h:outputLabel value="#{bundle.affiliation}" for="affiliation" class="col-sm-3 control-label">
                                        <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                              data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.affiliation.tip']}"></span>
                                    </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:inputText id="affiliation" styleClass="form-control" value="#{DataverseUserPage.userDisplayInfo.affiliation}" />
                                        <p:message for="affiliation" display="text" />
                                    </div>
                                </div>
                                <div class="form-group" jsf:rendered="#{DataverseUserPage.editMode == 'CREATE' or DataverseUserPage.editMode == 'EDIT'}">
                                <!-- Position -->
                                <h:outputLabel value="#{bundle.position}" for="position" class="col-sm-3 control-label">
                                    <span class="glyphicon glyphicon-question-sign tooltip-icon"
                                          data-toggle="tooltip" data-placement="auto right" data-original-title="#{bundle['user.position.tip']}"></span>
                                </h:outputLabel>
                                    <div class="col-sm-4">
                                        <p:inputText id="position" styleClass="form-control" value="#{DataverseUserPage.userDisplayInfo.position}" />
                                        <p:message for="position" display="text" />
                                    </div>
                                </div>
                                <ui:fragment rendered="#{DataverseUserPage.editMode == 'CREATE'}">
                                <!-- Terms of Use -->
                                    <ui:include src="termsofuse.xhtml"/>
                                </ui:fragment>
                                <div class="form-group">
                                    <div class="col-sm-12 button-block">
                                        <p:commandButton id="save" styleClass="btn btn-default"
                                                         value="#{DataverseUserPage.editMode == 'CREATE' ? bundle['user.createBtn']:bundle.saveChanges}"
                                                         action="#{DataverseUserPage.save}" update="@form,:messagePanel,:userDisplayInfoTitle"/>
                                        <p:commandButton id="cancel" styleClass="btn btn-link" value="#{bundle.cancel}"
                                                         action="#{DataverseUserPage.cancel}" process="@this" update="@form">
                                            <p:resetInput target="@form"/>
                                        </p:commandButton>
                                    </div>
                                </div>
                            </div>
                        </p:tab>
                    </p:tabView>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
